package com.foreknow.demo10;

import java.util.*;

public class Example1 {
    public Integer num(String string){
        String J = "aA";
        char[] chars = J.toCharArray();
        char[] str = string.toCharArray();
        List<Character> list = new ArrayList<>();
        for (int i = 0;i<str.length;i++){
            list.add(str[i]);
        }
        int num = 0;
        for (int i = 0;i < chars.length;i++){
            for (int k = 0;k<list.size();k++) {
                if (list.get(i).equals(chars[i])){
                    num += 1;
                }
            }
        }
        return num;
    }

    public static void main(String[] args) {
        String string = "adsasdAdhaA";
        Example1 test = new Example1();
        int n = test.num(string);
        System.out.println(n);
    }
}
